<%--
  Created by IntelliJ IDEA.
  User: Phillip
  Date: 2014/4/29
  Time: 2:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
    if (request.getAttribute("logout") != null && (int) request.getAttribute("logout") == 1) {
        session.setAttribute("isLogon", false);
        session.removeAttribute("username");
        session.removeAttribute("name");
        session.removeAttribute("credit");
        session.removeAttribute("mobile");
        session.removeAttribute("email");
    }
%>

<html>
  <head>
    <title>Flight Booking Centre</title>
  </head>
  <body>
    <H1 align="center">
        Flight Booking Centre
    </H1>
  <br>
  <br>
    <%
        if (request.getAttribute("isValidated") != null && !(boolean) request.getAttribute("isValidated"))
            out.println("<div align=\"center\" style=\"color:red\">Log in failed, pleas try again!</div>");
    %>
  <form method="POST" action="/Validate">
      <TABLE align="center">
          <TR>
              <TD>
                  Username:
              </TD>
              <TD>
                  <input type="text" name="username">
              </TD>
          </TR>
          <TR>
              <TD>
                  Password:
              </TD>
              <TD>
                  <input type="password" name="password">
              </TD>
          </TR>
      </TABLE>
      <div align="center">
          <input type="submit" value="LOG IN"><input type="button" value="REGISTER" onclick="window.location.href='register.jsp'">
      </div>

  </form>


  </body>
</html>
